package com.hzlx.service.impl;/*
 *@author liu
 *2024/07/2024/7/29
 *@version
 */

import com.hzlx.common.ResponseBean;
import com.hzlx.entity.CustomerBankCard;
import com.hzlx.mapper.CustomerBankCardMapper;
import com.hzlx.service.CustomerBankCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import java.util.List;

/**
 * @Author UP
 * @Date 2024/7/29 11:52
 * @Version 1.0
 **/
@Service
public class CustomerBankCardServiceImpl implements CustomerBankCardService {
    @Autowired
    private CustomerBankCardMapper customerBankCardMapper;
    @Override
    public ResponseBean getByCustomerId(Integer customerId, Model model) {
        if (customerId == null) {
            return new ResponseBean(10003, "参数获取失败", null);
        }
        List<CustomerBankCard> customerBankCardList = customerBankCardMapper.getByCustomerId(customerId);
        if (customerBankCardList == null) {
            return new ResponseBean(10004, "客户名下无银行卡", null);
        }
        model.addAttribute("customerBankCardList", customerBankCardList);
        return new ResponseBean(0, "success", customerBankCardList);
    }
}

